<template>
	<view :style="objColor">
		<!-- pages/login/login.wxml -->
		<view class="loginBox">
			<view class="content">
				<image class="header-image"
					:src="mobilePlatformLogo || 'https://oos-cn.ctyunapi.cn/front-end/static/static/noLogin.png'">
				</image>
				<!-- <image class="header-image" src="https://oos-cn.ctyunapi.cn/front-end/static/static/loginLogo.png" v-if="sellerNo == 'lp'"></image>
				<image class="xj-header-image" src="https://oos-cn.ctyunapi.cn/front-end/static/static/xjgxkcLogo.png" v-if="sellerNo == 'xjgxkc'"></image> -->
				<view class="loginTip">
					<!-- #ifdef H5  -->
					<!-- <view>欢迎使用充电</view> -->
					<!-- #endif -->
					<!-- #ifdef APP-PLUS  -->
					<view>欢迎使用{{ mobilePlatformName || '充电小程序' }}</view>
					<!-- #endif -->
					<!-- #ifdef MP-WEIXIN || MP-ALIPAY  -->
					<view>欢迎使用{{ mobilePlatformName || '充电小程序' }}</view>
					<!-- <view v-if="sellerNo == 'lp'">欢迎使用{{name}}</view>
						<view v-else-if="sellerNo == 'xjgxkc'">
							欢迎使用{{name}}  
						</view> -->
					<!-- <view>将获取您的手机号以便快速登录</view> -->
					<!-- #endif -->
				</view>

				<view>
					<!-- #ifdef H5 || APP-PLUS -->
					<view class="form">
						<view class="form_item flex-row-start">
							<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/phone.png" mode=""></image>
							<input type="number" class="form_item_input flex_1" v-model.trim="form.phoneNo"
								maxlength="11" placeholder="请输入手机号码">
						</view>
						<view class="form_item flex-row-start" v-show="loginType === 1">
							<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/Verification code.png"
								mode="">
							</image>
							<input type="number" class="form_item_input flex_1" v-model.trim="form.codeNum"
								maxlength="6" placeholder="请输入验证码">
							<text :class="['code', { code2: form.phoneNo.length === 11 }]" @tap="getVerifyCode"
								v-if="isShowCode">发送验证码</text>
							<text class="code" v-else>{{ codeText }}</text>
						</view>
						<view class="form_item flex-row-start" v-show="loginType === 2">
							<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/Verification code.png"
								mode="">
							</image>
							<input type="password" class="form_item_input flex_1" v-model.trim="form.password"
								maxlength="16" placeholder="请输入密码">
						</view>
					</view>
					<button
						:class="['btn', { btn2: form.phoneNo.length === 11 && (form.codeNum.length > 3 || form.password.length > 5) }]"
						@tap="login">登录</button>
					<view class="loginType">
						<text class="tab" @tap="changeLogin">{{ loginType === 1 ? '使用密码登录' : '使用验证码登录' }}</text>
						<navigator url="/homeSub/pages/setPassword/setPassword" class="pass" v-if="loginType === 2">忘记密码
						</navigator>
					</view>
					<!-- #endif -->

					<!-- #ifdef MP-WEIXIN || MP-ALIPAY -->
					<template v-if="!isWxPhoneLogin">
						<button v-if="!isAgree" class="btn2" @tap="getAgree">手机号快捷登录</button>
						<button v-else-if="!isWxNewMember" class="btn2" @tap="toLogin">手机号快捷登录</button>
						<button class="btn2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
							v-else>手机号快捷登录</button>
						<!-- v-if="sellerNo == 'jw' || sellerNo == 'ydcp'" -->
						<view v-if="!isTjhz()" class="wxPhoneLogin" @click="isWxPhoneLogin=true">手机号码登录/注册</view>
					</template>
					<view class="wxPhoneLoginWrap" v-else>
						<view v-if="!wxPhoneLoginVerify">
							<view class="tips">为方便取得联系，请输入您常用手机号码</view>
							<view class="form">
								<view class="form_item flex-row-start">
									<view class="form_item_title" style="margin-right: 40rpx;color: #606266;">手机号</view>
									<input type="number" class="form_item_input flex_1" v-model.trim="form.phoneNo"
										maxlength="11" placeholder="请输入手机号码">
								</view>
							</view>
							<button :class="['btn', {btn2: form.phoneNo.length === 11}]"
								@tap="getWxPhoneLogin">获取验证码</button>
							<view class="wxPhoneLogin" @click="isWxPhoneLogin=false">手机号快捷登录</view>
						</view>
						<view v-else>
							<view class="tips">验证码已经发送至手机 {{getPhoneStr(form.phoneNo)}}</view>
							<input type="number" class="wxPhoneLoginVerifyFocus" v-model.trim="form.codeNum"
								maxlength="6" @input="wxPhoneLoginVerifyChange" placeholder="请输入验证码"
								:focus="wxPhoneLoginVerifyFocus" @blur="wxPhoneLoginVerifyFocus=false">
							<view class="flex-row-center wxPhoneLoginVerifyCode" @click="wxPhoneLoginVerifyFocus=true">
								<view class="flex-row-start">
									<view class="wxPhoneLoginVerifyCode_item flex-row-center" v-for="(item,index) in 6">

										<template
											v-if="form.codeNum && form.codeNum[index]">{{form.codeNum[index]}}</template>
									</view>
								</view>
							</view>

							<button :class="['btn', {btn2: form.phoneNo.length === 11 && !codeSecond}]"
								@tap="getWxPhoneLogin">获取验证码
								<text v-if="codeSecond">（{{codeSecond}}s）</text></button>
							<view class="wxPhoneLogin" @click="isWxPhoneLogin=false">手机号快捷登录</view>
						</view>


					</view>
					<!-- #endif -->
				</view>
			</view>


			<view :class="[sellerNo == 'guangye' || sellerNo == 'yckc' || sellerNo == 'csht' ? 'gy_agree' : 'agree']">
				<image class="img"
					:src="isAgree ? sellerNo=='jw'?'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/checkbox_sel-blue.png':'https://oos-cn.ctyunapi.cn/front-end/static/static/checkbox_sel.png' : 'https://oos-cn.ctyunapi.cn/front-end/static/static/checkbox.png'"
					@tap="onAgree"></image>
				<view class="txt">
					<span @tap="onAgree">我已阅读并同意</span>
					<text @tap="goUserAgreement">《服务协议》</text>
					和
					<text @tap="goPrivacyPolicy">《隐私政策》</text>
				</view>
			</view>
		</view>

		<u-popup mode='center' :show="showTip" @close="onPopupBtn" :closeOnClickOverlay='false'
			:safeAreaInsetBottom='false'
			custom-style="background: #FFFFFF;border-radius: 16rpx;width:630rpx;overflow:hidden;">
			<!-- #ifdef MP-WEIXIN || MP-ALIPAY -->
			<template>
				<view class="popupTitle">用户协议和隐私政策</view>
				<view class="popupTxt">
					欢迎使用{{ mobilePlatformName || '充电小程序' }}，我们非常重视您的个人信息和隐私保护，在使用“{{ mobilePlatformName || '充电小程序' }}“充电服务之前，请务必认真阅读<text
						@tap="goUserAgreement">《服务协议》</text>和<text
						@tap="goPrivacyPolicy">《隐私政策》</text>，并充分理解各协议条款内容，包括但不限于用户注意事项、用户行为规则以及为了向您提供服务而收集、使用、存储您个人信息的情况等。我们将严格按照您同意的各项条款使用您的个人信息，以便为您提供更好的服务。如您同意，请点击下发按钮开始接受我们的服务。

				</view>
				<view class="popupBtn">
					<view class="popupBtn1" @tap="onPopupBtn" data-type="close">暂不同意</view>
					<view class="popupBtn2" @tap="onPopupBtn" data-type="open">同意并接受</view>
				</view>
			</template>
			<!-- #endif -->

			<!-- #ifndef MP-WEIXIN || MP-ALIPAY -->
			<template>
				<view class="popupTitle">温馨提示</view>
				<view class="popupTxt">
					使用前，请你详细阅读
					<text @tap="goUserAgreement">《服务协议》</text>
					和
					<text @tap="goPrivacyPolicy">《隐私政策》</text>
					并同意后，开始使用充电服务。
				</view>
				<view class="popupBtn">
					<!-- 	<view class="popupBtn1" @tap="onPopupBtn" data-type="close">取消</view> -->
					<view class="popupBtn2" @tap="onPopupBtn" data-type="close">确定</view>
				</view>
			</template>
			<!-- #endif -->



		</u-popup>

		<!-- 完善个人信息 -->
		<u-popup mode='center' :show="showSetInfo" @close="showSetInfo = false" :closeOnClickOverlay='false'
			:safeAreaInsetBottom='false'
			custom-style="background: #FFFFFF;border-radius: 16rpx;width:630rpx;overflow:hidden;">
			<template>
				<view class="popupTitle">温馨提示</view>
				<view class="popupTxt">
					请完善个人信息，方便我们为您提供更好的服务。完善后，我们将严格按照
					<text @tap="goUserAgreement">《用户协议》</text>
					和
					<text @tap="goPrivacyPolicy">《隐私政策》</text>
					中的各项条款使用您的个人信息。
				</view>
				<view class="popupBtn">
					<view class="popupBtn1" @click="toSetInfo('close')">忽略</view>
					<view class="popupBtn2" @click="toSetInfo('go')">去完善</view>
				</view>
			</template>
		</u-popup>

		<!-- 手机号码已经关联其他微信提示 -->
		<u-popup mode='center' :show="showTips2" @close="showTips2 = false" :closeOnClickOverlay='false'
			:safeAreaInsetBottom='false'
			custom-style="background: #FFFFFF;border-radius: 16rpx;width:630rpx;overflow:hidden;">
			<template>
				<view class="popupTitle">温馨提示</view>
				<view class="popupTxt">
					您的手机号码已关联其他微信账号，是否继续使用该手机号码登录？
				</view>
				<view class="popupBtn">
					<button class="popupBtn1" @click="returnNumberLogin" v-if="isWxPhoneLogin">换手机号码</button>
					<button class="popupBtn1" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
						v-else>换手机号码</button>
					<view class="popupBtn2" @click="continueLogin">继续登录</view>

				</view>
			</template>
		</u-popup>

		<u-popup mode='center' :show="verifyCodeShow" @close="onPopupBtn" class="verify-box"
			:closeOnClickOverlay='false' :safeAreaInsetBottom='false'
			custom-style="background: #FFFFFF;border-radius: 16rpx;width:630rpx;overflow:hidden;">
			<view class="popupTxt">
				<view class="verify-title">验证码</view>
				<view class="verify-code">
					<image :src="verifyCodeImg" mode="heightFix"></image>
					<text @tap="getVerifyCode">换一张</text>
				</view>

				<input class="verify-input" v-model.trim="verifyCode" placeholder="请输入图片的字符"
					placeholder-class="placeholderStyle">
			</view>
			<view class="popupBtn">
				<view class="popupBtn1" @tap="onVerifyPopupBtn" data-type="close">取消</view>
				<view class="popupBtn2" @tap="onVerifyPopupBtn" data-type="submit">确定</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	'use strict';
	var app = getApp();
	var https_1 = require('api/https.js');
	var util_1 = require('utils/util.js');
	var scanCode_1 = require('utils/scanCode.js');
	import {
	getMemberInfo
} from 'api/https';
import {
	newUserRegister
} from 'api/marketing/invitation';
import {
	promotionUserAdd,
	promotionAddReward
} from 'api/marketing/promotion';
import {
	inviteRewardRegister
} from 'api/marketing/invitation';
	var throttle = new util_1.Throttle();

	export default {
		components: {},
		data() {
			return {
				codeSecond: 0, //验证码秒数
				isWxPhoneLogin: false, //是否显示微信验证码登录
				wxPhoneLoginVerifyFocus: false, //微信小程序是否获取焦点
				wxPhoneLoginVerify: false, //微信小程序是否发送过验证码

				promotionsRewardsTime: 0,
				hasUserInfo: false, //是否已获取用户信息
				canIUseAvatar: uni.canIUse('button.open-type.chooseAvatar'),
				canIUseGetUserProfile: false,
				canIUse: uni.canIUse('button.open-type.getUserInfo'),
				hasPhoneNumber: false,

				isShowCode: true, //是否显示验证码按钮
				codeText: '', //验证码倒计时文案
				userInfo: {}, //用户信息
				form: {
					phoneNo: '',
					codeNum: '',
					password: '',
					encryptedData: ''
				}, // 表单信息、
				isAgree: false, //是否同意协议
				showTip: false, //是否显示协议窗口
				verifyCodeShow: false, //图片验证码窗口
				verifyCodeImg: '', //图片验证码图
				verifyCode: '', //图片验证码
				loginType: 1, //登录方式：1、验证码，2、密码
				sellerNo: null,
				name: null,
				isWxNewMember: false, //微信用户是否新用户
				showSetInfo: false, //是否显示完善信息弹窗
				showTips2: false, //手机号码关联其他微信号提示弹窗
				mobilePlatformLogo: null,
				mobilePlatformName: null,
				qrCode: null,
				qrCodeUrl: null,
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			const that = this
			if (options.qrCode) {
				this.qrCode = decodeURIComponent(options.qrCode)
			}

			if (options.qrCodeUrl) {
				this.qrCodeUrl = decodeURIComponent(options.qrCodeUrl)
			}

			// #ifdef MP-WEIXIN
			if (uni.getUserProfile) this.canIUseGetUserProfile = true;
			// #endif

			// #ifdef APP-PLUS
			if (this.isSellerXc()) {
				this.loginType = 2 // 默认使用账号密码登录
			}
			// #endif

			this.initConfig()
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			let that = this
			// #ifdef MP-WEIXIN
			if (uni.getUserProfile) this.canIUseGetUserProfile = true;
			app.uniLogin().then(() => {
				that.isWxNewMember = uni.getStorageSync('newMember')
				console.log('微信初始化code成功111111')
			})
			// #endif
			
			// #ifdef MP-ALIPAY
			app.uniALiPayLogin().then(() => {
				that.isWxNewMember = uni.getStorageSync('newMember')
				console.log('支付宝初始化code成功~~~~~~~',that.isWxNewMember)
			})
			// #endif

			this.sellerNo = app.globalData.sellerNo
			//清除账号身份
			uni.removeStorageSync('memberType');
			let shareData = app.getAppOptions()
			console.log(shareData, '是不是邀请进来的')
			// 判断是不是邀请进来的
			if (shareData.ST) {
				app.globalData.getCityId(() => {}, false, false)
			}
		},
		methods: {
			// 初始参数配置
			initConfig() {
				let that = this
				let {
					sellerNo,
					sellerId,
					name
				} = app.globalData
				that.sellerNo = sellerNo
				this.name = name
				this.mobilePlatformLogo = uni.getStorageSync('mobilePlatformLogo')
				this.mobilePlatformName = uni.getStorageSync('mobilePlatformName')
				console.log(that.sellerNo, 'sellerNo')
				let type = '5';
				const systemInfo = uni.getSystemInfoSync();
				let uniPlatform = systemInfo.uniPlatform;
				let platform = systemInfo.platform;
				if (uniPlatform == 'mp-weixin') {
					type = '3'
				} else if (uniPlatform == 'web') {
					if (sellerNo == 'changzhi') {
						// 微信公众号
						type = '2'
					} else {
						// 小程序 、h5传3
						type = '3'
					}
					console.log(type, 'ldsfkldjsakfljdsaklfjsassssssssssss')
				} else if (platform == 'ios') {
					type = '0'
				} else if (platform == 'android') {
					type = '1'
				}
				this.form.type = type
				this.form.sellerNo = sellerNo
				this.form.sellerId = sellerId

				// #ifdef APP-PLUS
				// 获取ip地址 浏览器会跨域忽略、app生效
				uni.request({
					url: 'http://pv.sohu.com/cityjson?ie=utf-8',
					method: 'POST',
					success: (res) => {
						const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
						let ip = reg.exec(res.data);
						that.form.ip = ip[0]
					}
				})
				// #endif
			},
			// 登录/注册完成设置缓存
			setUserInfo(res) {
				try {
					// #ifdef MP-WEIXIN
					uni.setStorageSync('tel', res.msg);
					uni.setStorageSync('token', res.data);
					// this.getUserType();
					this.getMemberInfo(() => {
						// 扫码跳转
						this.navCodePage()
						this.isHomePageBack();
					});
					// #endif




					// #ifdef H5 || APP-PLUS
					let {
						phoneNo,
						Authorization,
						firstRegister
					} = res.data;
					uni.setStorageSync('tel', phoneNo);
					uni.setStorageSync('token', Authorization);

					// this.getUserType();

					if (firstRegister) { // 首次登录
						let phone = phoneNo.slice(7)
						uni.showModal({
							title: '温馨提示',
							content: `尾号${phone}用户，您好，首次登录需要先设置 登录密码！`,
							cancelText: '暂不设置',
							confirmText: '立即设置',
							success: function(e) {
								if (e.confirm) {
									uni.navigateTo({
										url: '/homeSub/pages/setPassword/setPassword?type=setPassword&phone=' +
											phoneNo
									});
								} else if (e.cancel) {
									uni.reLaunch({
										url: '/pages/index/index'
									})
									// 扫码跳转
									this.navCodePage()
								}
							}
						});
					} else {
						this.getMemberInfo(() => {
							uni.reLaunch({
								url: '/pages/index/index'
							})
							// 扫码跳转
							this.navCodePage()
						});

					}
					// #endif
				} catch (error) {
					// console.log('error :>> ', error);
				}
			},
			//获取用户身份类型
			getUserType: function() {
				https_1.getUserType().then((res) => {
					if (res.code == 0) {
						uni.setStorageSync('userType', res.data.join());
						uni.setStorageSync('selUserType', res.data.includes('2') ? '2' : '0')
					}
				});
			},
			// 同意协议后获取手机号-wx
			getPhoneNumber(e) {
				this.showTips2 = false
				let {
					code,
					encryptedData,
					iv
				} = e.detail;
				if (e.detail.errMsg == "getPhoneNumber:ok" && encryptedData != '') { //获取手机号成功
					this.form = {
						...this.form,
						encryptedData,
						iv
					};
					// #ifdef MP-ALIPAY
					this.form.sign = e.detail.sign
					// #endif

					// this.loginWx();
					// 整改优化登录接口5.24
					this.toWxRegister({
						...this.form,
					});
				} else {
					uni.showToast({
						title: '获取手机号失败',
						icon: 'none',
						duration: 2000
					})
				}
			},
			// 获取个人信息-wx
			getUserProfile() {
				if (this.getAgree()) {
					return
				}
				throttle.use(() => {
					uni.getUserProfile({
						desc: '用于完善会员资料',
						success: (res) => {
							this.setData({
								userInfo: res.userInfo,
								hasUserInfo: true,
							});
							this.registerWx();
						}
					})
				}, 3000)
			},
			// 获取个人信息(兼容微信版本7.0.9已下版本)-wx
			getUserInfo(e) {
				this.getAgree();
				// 不推荐使用getUserInfo获取用户信息，预计自2021年4月13日起，getUserInfo将不再弹出弹窗，并直接返回匿名的用户个人信息
				this.setData({
					userInfo: e.detail.userInfo,
					hasUserInfo: true
				});
				this.registerWx();
			},
			// 登录-wx
			loginWx() {
				uni.showLoading({
					title: '登录中...',
					mask: true
				})
				let {
					encryptedData,
					sellerNo,
					iv
				} = this.form;
				https_1.loginCheck({
					openId: uni.getStorageSync('openId'),
					unionId: uni.getStorageSync('unionId'),
					phoneKey: uni.getStorageSync('session_key'),
					encryptedData, //手机号
					iv, //解密参数
					sellerNo,
					type: '3'
				}).then(res => {
					uni.hideLoading()
					if (res.code == 0) { //手机号已注册过 重新获取token登录
						uni.setStorageSync('newPeople', false);
						this.setUserInfo(res);
					} else {
						// this.hasPhoneNumber = true;
						// this.hasUserInfo = false;
						this.registerWx();
					}
				})
			},
			// 整改后的微信登录
			// loginWxZG(){
			// 	https_1.loginCheck({
			// 		openId: uni.getStorageSync('openId'),
			// 		unionId: uni.getStorageSync('unionId'),
			// 		phoneKey: uni.getStorageSync('session_key'),
			// 		encryptedData,//手机号
			// 		iv, //解密参数
			// 		sellerNo,
			// 		type: '3'
			// 	}).then(res => {
			// 		uni.hideLoading()
			// 		if (res.code == 0) {  //手机号已注册过 重新获取token登录
			// 			uni.setStorageSync('newPeople', false);
			// 			this.setUserInfo(res);
			// 		} else {
			// 			// this.hasPhoneNumber = true;
			// 			// this.hasUserInfo = false;
			// 			this.registerWx();
			// 		}
			// 	})
			// },
			// 注册-wx
			registerWx() {
				uni.showLoading({
					title: '注册中...',
					mask: true
				})
				let {
					encryptedData,
					sellerNo,
					iv
				} = this.form;
				//手机号未注册
				let data = {
					openId: uni.getStorageSync('openId'),
					unionId: uni.getStorageSync('unionId'),
					phoneKey: uni.getStorageSync('session_key'),
					encryptedData, //手机号
					iv, //解密参数
					sellerNo,
					type: '3',
					name: '微信用户',
					icon: 'https://oos-cn.ctyunapi.cn/front-end/static/static/header-1.png',
					inviterMemberId: null, //邀请人Id
					areaId: uni.getStorageSync('cityId'),
					inviteType: uni.getStorageSync('inviteType') || 3,
					//邀请类型 1邀请 2推广 3自己注册
					inviterId: uni.getStorageSync('inviterId') || '',
					//邀请人id
					promoterId: uni.getStorageSync('promoterId') || '' //推广人id
				}
				https_1.login(data).then(res => {
					uni.hideLoading()
					if (res.code == 0 || res.code == 2) { //注册成功
						// uni.setStorageSync('newPeople', true);
						// this.setUserInfo(res);


						uni.setStorageSync('token', res.data);
						uni.setStorageSync('tel', res.msg);
						uni.setStorageSync('newPeople', true);
						this.getMemberInfo(() => {
							console.log('走注册逻辑!!!');
							// 注册获取奖励 领取新人奖励 、邀请奖励、推广奖励，
							this.registerGetAward();
							//删掉第一次注册的状态啊;
							uni.removeStorageSync('firstRegister');

							// 扫码跳转
							this.navCodePage()

						});
					} else { // 绑定失败
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
				}).catch(() => {
					uni.hideLoading()
				})
			},
			// 校验表单方法
			// checkForm['phoneNo']
			checkForm(names = []) {
				let {
					phoneNo,
					codeNum,
					password
				} = this.form
				let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; //11位手机号码正则
				let state = true
				if (names.includes('phoneNo')) {
					if (!phoneNo || phoneNo.length != 11) {
						state = false
					} else if (!reg_tel.test(phoneNo)) {
						uni.showToast({
							title: '手机号码格式有误，请核实',
							icon: 'none',
						})
						state = false
					}
				}
				if (state && names.includes('codeNum')) {
					if (!codeNum || codeNum.length < 4) {
						state = false
					}
				}
				if (state && names.includes('password')) {
					if (!password || password.length < 6) {
						state = false
					}
				}

				return state
			},
			// 验证码倒计时
			codeCountDown() {
				let codeSecond = 60
				this.isShowCode = false
				this.codeSecond = codeSecond
				this.codeText = `${codeSecond}秒后重新获取`

				let getCodeTimer = setInterval(() => {
					codeSecond--
					this.codeSecond = codeSecond
					this.codeText = `${codeSecond}秒后重新获取`
					if (codeSecond == 0) {
						clearInterval(getCodeTimer)
						this.isShowCode = true
					}
				}, 1000)
				this.getCodeTimer = getCodeTimer
			},
			// 获取图片验证码
			getVerifyCode() {
				if (this.isShowCode) {
					if (!this.checkForm(['phoneNo'])) return;
					if (!this.isAgree) return this.showTip = true;
					this.verifyCodeImg = '';
					let {
						type
					} = this.form;
					let _src = uni.getStorageSync('ApiUrl') + '/api-service/api/verifyCode?type=' + type + '&t=' +
						new Date()
						.getTime()
					this.setData({
						verifyCodeImg: _src,
						verifyCodeShow: true
					})
				}
			},
			// 验证图片验证码
			checkVerifyCode() {
				let {
					type
				} = this.form;
				let code = this.verifyCode;
				return https_1.checkVerifyCode({
					type,
					loginCaptcha: code
				})
			},
			// 关闭图片验证码对话框
			async onVerifyPopupBtn(e) {
				var type = e.currentTarget.dataset.type;

				if (type === 'submit') {
					if (!this.verifyCode) {
						uni.showToast({
							title: '请输入验证码',
							icon: 'none',
						})
						return
					}
					const verify_res = await this.checkVerifyCode();
					if (verify_res.code === 0) {
						this.getCode();
						this.setData({
							verifyCodeShow: false
						});
					} else {
						uni.showToast({
							title: verify_res.msg || '验证码错误',
							icon: 'none',
						})
					}
				} else {
					this.setData({
						verifyCodeShow: false
					});
				}
			},
			// 获取短信验证码
			getCode() {
				if (this.isShowCode) {
					if (!this.checkForm(['phoneNo'])) return;

					let {
						phoneNo,
						sellerNo,
						type
					} = this.form
					https_1.getCode({
						phoneNo,
						sellerNo,
						type
					}).then(res => {
						if (res.code == 0) {
							this.codeCountDown()
							uni.showToast({
								title: '验证码已发送到您的手机,请注意查收',
								icon: 'none',
							})
						} else {
							uni.showToast({
								title: res.msg || '发送失败',
								icon: 'none',
							})
						}
					})
				}
			},
			// 登录按钮事件
			changeLogin() {
				this.loginType = this.loginType === 1 ? 2 : 1;
				this.form.codeNum = '';
				this.form.password = '';
			},
			// 触发登录
			login() {
				if (!this.isAgree) return this.showTip = true
				if (this.loginType === 1) {
					if (!this.checkForm(['phoneNo', 'codeNum'])) return;
					this.registerOrLogin()
				} else {
					if (!this.checkForm(['phoneNo', 'password'])) return;
					this.loginByPassword()
				}

				// this.loginApp().then(res => {
				// 	this.userInfo = {}
				// 	this.setUserInfo(res)
				// 	uni.hideLoading();
				// }).catch(err => {
				// 	uni.hideLoading();
				// })
			},
			// H5|APP登录、注册--验证码
			registerOrLogin() {
				uni.showLoading({
					title: '加载中......'
				});
				let {
					phoneNo,
					codeNum,
					type,
					sellerNo,
				} = this.form;
				let data = {
					phoneNo,
					codeNum,
					type,
					sellerNo,
					icon: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
					areaId: uni.getStorageSync('cityId'),
				}
				https_1.registerOrLogin(data).then(res => {
					uni.hideLoading();
					if (res.code == 0) {
						this.setUserInfo(res);
					} else {
						uni.showToast({
							title: res.msg || '错误代码',
							icon: 'none',
						})
					}
				})
			},
			// H5|APP登录、注册--密码
			loginByPassword() {
				const that = this
				uni.showLoading({
					title: '加载中......'
				});
				let {
					phoneNo,
					password,
					type,
					sellerNo
				} = this.form;
				let data = {
					phoneNo,
					password,
					type,
					sellerNo,
					// name:phoneNo,
				}
				https_1.loginByPassword(data).then(res => {
					uni.hideLoading();
					if (res.code == 0) {
						uni.setStorageSync('tel', res.msg);
						uni.setStorageSync('token', res.data);
						// this.getUserType();
						uni.reLaunch({
							url: '/pages/index/index'
						})
						// 扫码跳转
						this.navCodePage()
					} else if (res.code == 12) {
						uni.showModal({
							title: '温馨提示',
							content: '暂未注册，请使用验证码登录',
							success: function(e) {
								if (e.confirm) {
									that.loginType = 1;
								}
							}
						});
					} else {
						uni.showToast({
							title: res.msg || '错误代码',
							icon: 'none',
						})
					}
				})
			},
			// 微信小程序获取验证码
			getWxPhoneLogin() {
				if (this.isShowCode) {
					if (!this.checkForm(['phoneNo'])) return;
					if (!this.isAgree) return this.showTip = true;

					let {
						phoneNo,
						sellerNo,
						type
					} = this.form
					console.log({
						phoneNo,
						sellerNo,
						type
					}, '这是验证码')
					let reqForm = {
						phoneNo,
						sellerNo,
						type: '3'
					}
					// #ifdef MP-ALIPAY
					reqForm.type = 7
					// #endif
					https_1.getCode(reqForm).then(res => {
						if (res.code == 0) {
							this.wxPhoneLoginVerify = true
							this.wxPhoneLoginVerifyFocus = true
							this.codeCountDown()
							uni.showToast({
								title: '验证码已发送到您的手机,请注意查收',
								icon: 'none',
							})
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
							})
						}
					})

				}
			},
			// 微信小程序获取验证码登录6位数执行登录
			wxPhoneLoginVerifyChange(e) {
				let that = this
				if (e.detail.value && e.detail.value.length == 6) {
					console.log('开始执行')
					that.wxPhoneLoginVerifyFocus = false
					// getApp().showLoading()
					let {
						phoneNo,
						codeNum,
						sellerNo,
					} = this.form;
					let data = {
						openId: uni.getStorageSync('openId'),
						unionId: uni.getStorageSync('unionId') || null,
						sellerNo,
						phone: phoneNo,
						type: '3',
						code: codeNum,
						name: '微信用户',
						icon: 'https://oos-cn.ctyunapi.cn/front-end/static/static/header-1.png',
						areaId: uni.getStorageSync('cityId'),
						inviteType: uni.getStorageSync('inviteType') || 3,
						//邀请类型 1邀请 2推广 3自己注册
						inviterId: uni.getStorageSync('inviterId') || '',
						//邀请人id
						promoterId: uni.getStorageSync('promoterId') || '' //推广人id
					}
					// #ifdef MP-ALIPAY
					data.name = "支付宝用户"
					data.type = 7
					// #endif

					https_1.loginAndRegisterByCode(data).then(res => {
						console.log(res, '手机号码登录拉111')
						uni.hideLoading();
						if (res.code != 0) {
							that.form.codeNum = ''
						}
						if (res.code == 0) {
							uni.setStorageSync('newPeople', false);
							uni.setStorageSync('tel', res.data.phoneNo);
							uni.setStorageSync('token', res.data.Authorization);
							if (res.data.register) {
								this.showSetInfo = true
								this.getMemberInfo(() => {
									console.log('走注册逻辑!!!');
									// 注册获取奖励 领取新人奖励 、邀请奖励、推广奖励，
									this.registerGetAward();
									//删掉第一次注册的状态啊;
									uni.removeStorageSync('firstRegister');
								});
							} else {
								uni.showToast({
									title: '登录成功',
									duration: 3000,
									icon: 'none',
								})
								setTimeout(() => {
									this.getMemberInfo(() => {
										this.navCodePage()
										this.isHomePageBack();
									});
								}, 3000)

							}
							// that.setUserInfo(res)
						} else if (res.code == 6000) {
							this.showTips2 = true
						} else if (res.code == 11) {
							console.log('验证码错误，', res)
							uni.showToast({
								title: res.msg || '验证码错误',
								duration: 3000,
								icon: 'none',
							})
							that.wxPhoneLoginVerifyFocus = true
						}
					})
				
				}
			},

			// APP登录接口
			loginApp() {
				let {
					phoneNo,
					codeNum,
					type,
					ip,
					sellerNo,
					sellerId,
					iv,
					password
				} = this.form;
				let data = {
					codeNum,
					password,
					type,
					name: phoneNo,
					phoneNo,
					ip: ip || 'http://1.14.130.48',
					sellerNo,
					sellerId,
					iv,
					actualIrrigationDitch: 3,
				}
				return new Promise((resolve, reject) => {
					https_1.loginApp(data).then(res => {
						if (res.code == 0) {
							resolve(res)
						} else if (res.code == 4) {
							// 手机号未注册
							this.registerApp(data).then(res => {
								resolve(res)
							}).catch(err => {
								reject(res)
							})
						} else {
							reject(res)
							// 验证码错误
							uni.showToast({
								title: res.msg || '错误代码',
								icon: 'none',
							})
						}
					})
				})
			},
			// APP注册接口
			registerApp(data) {
				return new Promise((resolve, reject) => {
					https_1.registerApp(data).then(res => {
						if (res.code == 0) {
							resolve(res);
							let phone = this.form.phoneNo.slice(7)
							uni.showModal({
								title: '温馨提示',
								content: `尾号${phone}用户，您好，首次登录需要先设置 登录密码！`,
								cancelText: '暂不设置',
								confirmText: '立即设置',
								success: function(e) {
									if (e.confirm) {
										uni.navigateTo({
											url: '/homeSub/pages/setPassword/setPassword?type=setPassword'
										});
									}
								}
							});
						} else {
							reject(res)
						}
					})
				})
			},

			//未同意协议点击获取手机号
			getAgree: function() {
				if (!this.isAgree) {
					this.setData({
						showTip: true
					});
				}

				return !this.isAgree;
			},
			// 同意/取消协议
			onAgree: function() {
				this.setData({
					isAgree: !this.isAgree
				});
			},
			// 未同意协议对话框
			onPopupBtn: function(e) {
				var type = e.currentTarget.dataset.type;

				if (type === 'open') {
					this.setData({
						isAgree: true,
						showTip: false
					});
				} else {
					this.setData({
						showTip: false
					});
				}
			},
			// 用户使用协议
			goUserAgreement: function() {
				if (app.globalData.sellerNo == 'lp') {
					uni.navigateTo({
						url: '/agreement/pages/userAgreement/userAgreement-lp'
					});
				} else {
					uni.navigateTo({
						url: '/agreement/pages/userAgreement/userAgreement'
					});
				}
			},
			// 隐私政策
			goPrivacyPolicy: function() {
				if (app.globalData.sellerNo == 'lp') {
					uni.navigateTo({
						url: '/agreement/pages/privacyPolicy/privacyPolicy-lp'
					});
				} else {
					uni.navigateTo({
						url: '/agreement/pages/privacyPolicy/privacyPolicy'
					});
				}
			},
			// 推广分享调用接口 获取推广奖励
			async promotionsRewards() {
				let plUserId = uni.getStorageSync('promoterId');
				let spededUserId = uni.getStorageSync('memberId');
				let sellerId = app.globalData.sellerId;
				let data = {
					applyChannel: 1,
					plUserId,
					spededUserId,
					sellerId
				};
				console.log('这是推广数据', data);
				try {
					const res = await promotionUserAdd(data);
					console.log(res, '推广第一个接口..');
					if (res.code == 200) {
						const res1 = await promotionAddReward(data);
						console.log(res1, '推广第二个接口..');
						if (res1.code == 200) {
							console.log(res1, '推广成功拉..');
						}
					}
				} catch (error) {
					console.log('js报错拉');
				}
				console.log('推广结束是否执行');
			},

			// 获取邀请奖励
			inviteRewardRegister() {
				let registerUserId = uni.getStorageSync('memberId');
				let inviteUserId = uni.getStorageSync('inviterId');
				let inviteActivityId = uni.getStorageSync('inviteActivityId');
				let sellerId = app.globalData.sellerId;
				let data = {
					inviteUserId,
					registerUserId,
					sellerId,
					inviteActivityId
				};
				console.log('邀请开始拉', data);
				// setTimeout(() => {
				inviteRewardRegister(data).then((res) => {
					// console.log(res, '邀请第一个接口是否成功');
					console.log(res, '邀请奖励接口调取后,返回了什么=====');
				});
				// }, 5000);
			},

			getMemberInfo(cb) {
				getMemberInfo().then((res) => {
					if (res.code == 0) {
						uni.setStorageSync('memberId', res.data.memberId);
						uni.setStorageSync('deductMode', res.data.deductMode);
						uni.setStorageSync('userInfo', res.data);
						uni.setStorageSync('memberType', (+res.data.tokenMemberType))
						if (cb) {
							cb();
						}
					}
				});
			},
			// 获取新人弹窗奖励的方法接口
			getNewUserRegisterFn() {
				newUserRegister({
						registerUserId: uni.getStorageSync('memberId'),
						sellerId: app.globalData.sellerId
					})
					.then((res) => {
						console.log('是新人,并且走了注册接口', res);
						console.log('是新人,并且走了注册接口code值看奖励领取没', res.code);
						if (res.code == 200 && res.status == 'A0000') {
							uni.setStorageSync('newUserRegisterStatus', 2);
							console.log('领取成功啊!!!!');
						} else {
							console.log(res, '新人注册接口resdata的值是?');
						}

						// 是返回上一页还是返回首页
						this.isHomePageBack();
					})
					.catch((err) => {
						console.log(err);
					});
				console.log('newUserRegisterStatus值为', uni.getStorageSync('newUserRegisterStatus'));
			},

			//   注册获取奖励
			registerGetAward() {
				console.log('走注册逻辑22222');
				let inviteType = uni.getStorageSync('inviteType');
				let that = this;
				console.log(inviteType, '注册类型...');
				// 领取新人奖励

				// if (uni.getStorageSync('clickNewUserRegisterBag') == 88888) {
				// 	console.log('点击了领取礼包,去领取!!!!!');
				// 	this.getNewUserRegisterFn()
				// } else {
				// 	console.log('没点击新人礼包!!!');
				// 	console.log('clickNewUserRegisterBag值为', uni.getStorageSync('clickNewUserRegisterBag'));

				// 	// 是返回上一页还是返回首页
				// 	this.isHomePageBack();
				// }

				// 邀请奖励
				if (inviteType == 1) {
					setTimeout(() => {
						this.inviteRewardRegister();
					});
				} else {
					// 新客有礼奖励不通过点击首页弹窗, 不是通过邀请进去的人,直接扫体验版注册就可以
					setTimeout(() => {
						this.getNewUserRegisterFn()
					});
				}
				// 推广奖励
				if (inviteType == 2) {
					// setTimeout(() => {
					//     this.promotionsRewards()
					// });
					let count = 7;
					that.promotionsRewardsTime = setInterval(() => {
						console.log('延时统计推广执行11', count);
						if (count == 0) {
							clearInterval(that.promotionsRewardsTime);
						} else {
							count--;
							that.promotionsRewards();
							console.log('延时统计推广执行');
						}
					}, 1000);
					setTimeout(() => {
						this.promotionsRewards();
					});
				}
			},

			//是返回上一页还是返回首页
			isHomePageBack() {
				uni.navigateBack();
			},
			// 支付宝登录
			toAliLogin() {
				uni.showLoading({
					title: '登录中...',
					mask: true
				})
				https_1.loginBeforeCheck({
					openId: uni.getStorageSync('openId'),
					unionId: uni.getStorageSync('unionId') || null,
					phoneKey: uni.getStorageSync('session_key') || null,
					sellerNo: app.globalData.sellerNo,
					type: '7'
				}).then(res => {
					uni.hideLoading()
					if (res.code == 0) { //手机号已注册过 重新获取token登录
						uni.setStorageSync('newPeople', false);
						console.log(res, '这是登录啦啦')
						uni.setStorageSync('tel', res.data.phoneNo);
						uni.setStorageSync('token', res.data.Authorization);
						// this.getUserType();
						this.getMemberInfo(() => {
							this.isHomePageBack();
						});
					}
				})
			},
			// 微信登录
			toWxLogin() {
				uni.showLoading({
					title: '登录中...',
					mask: true
				})
				https_1.loginBeforeCheck({
					openId: uni.getStorageSync('openId'),
					unionId: uni.getStorageSync('unionId') || null,
					phoneKey: uni.getStorageSync('session_key'),
					sellerNo: app.globalData.sellerNo,
					type: '3'
				}).then(res => {
					uni.hideLoading()
					if (res.code == 0) { //手机号已注册过 重新获取token登录
						uni.setStorageSync('newPeople', false);
						console.log(res, '这是登录啦啦')
						uni.setStorageSync('tel', res.data.phoneNo);
						uni.setStorageSync('token', res.data.Authorization);
						// this.getUserType();
						this.getMemberInfo(() => {
							this.navCodePage()
							this.isHomePageBack();
						});
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
						})
					}
				})
			},
			toLogin() {
				// #ifdef MP-ALIPAY
				this.toAliLogin()
				// #endif

				// #ifdef MP-WEIXIN
				this.toWxLogin()
				// #endif
			},
			toWxRegister(data) {
				uni.showLoading({
					title: '登录中...',
					mask: true
				})
				let {
					encryptedData,
					iv
				} = data
				let reqForm = {
					openId: uni.getStorageSync('openId'),
					unionId: uni.getStorageSync('unionId') || null,
					phoneKey: uni.getStorageSync('session_key'),
					sellerNo: app.globalData.sellerNo,
					type: '3',
					encryptedData, //手机号
					iv, //解密参数

					name: '微信用户',
					icon: 'https://oos-cn.ctyunapi.cn/front-end/static/static/header-1.png',
					inviterMemberId: null, //邀请人Id
					areaId: uni.getStorageSync('cityId'),
					inviteType: uni.getStorageSync('inviteType') || 3,
					//邀请类型 1邀请 2推广 3自己注册
					inviterId: uni.getStorageSync('inviterId') || '',
					//邀请人id
					promoterId: uni.getStorageSync('promoterId') || '' //推广人id
				}
				// #ifdef MP-ALIPAY
				reqForm.sign = data.sign
				reqForm.name = "支付宝用户"
				reqForm.type = 7
				// #endif

				https_1.loginAndRegister(reqForm).then(res => {
					uni.hideLoading()
					if (res.code == 0) { //手机号已注册过 重新获取token登录
						uni.setStorageSync('newPeople', false);
						uni.setStorageSync('tel', res.data.phoneNo);
						uni.setStorageSync('token', res.data.Authorization);
						if (res.data.register) {
							this.showSetInfo = true
							this.getMemberInfo(() => {
								console.log('走注册逻辑!!!');
								// 注册获取奖励 领取新人奖励 、邀请奖励、推广奖励，
								this.registerGetAward();
								//删掉第一次注册的状态啊;
								uni.removeStorageSync('firstRegister');
							});
						} else {
							this.getMemberInfo(() => {
								this.navCodePage()
								this.isHomePageBack();
							});
						}
						// this.getUserType();
						// this.getMemberInfo(() => {
						//     this.isHomePageBack();
						// });
					} else if (res.code == 6000) {
						this.showTips2 = true
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
						})
					}
				})
			},
			// 设置个人信息弹窗忽略完善个人信息按钮事件
			toSetInfo(status) {
				if (status == 'go') {
					this.showSetInfo = false
					this.getMemberInfo(() => {
						uni.reLaunch({
							url: '/agreement/pages/personalInfo/personalInfo'
						})
					});
				} else if (status == 'close') {
					this.showSetInfo = false
					this.getMemberInfo(() => {
						this.navCodePage()
						this.isHomePageBack();
					});
				}
			},
			// 微信号关联手机号码提示继续登录按钮事件
			continueLogin() {
				let that = this
				this.showTips2 = false
				let data = null

				let {
					encryptedData,
					iv,
				} = this.form
				// 验证码登录
				if (this.isWxPhoneLogin) {
					data = {
						type: 3,
						sellerNo: app.globalData.sellerNo,
						phone: that.form.phoneNo
					}
				} else {
					data = {
						type: 3,
						sellerNo: app.globalData.sellerNo,
						phoneKey: uni.getStorageSync('session_key'),
						encryptedData, //手机号
						iv, //解密参数
					}
				}
				https_1.loginOther(data).then(res => {
					uni.hideLoading()
					if (res.code == 0) { //手机号已注册过 重新获取token登录
						uni.setStorageSync('newPeople', false);
						console.log(res, '这是啦啦')
						uni.setStorageSync('tel', res.data.phoneNo);
						uni.setStorageSync('token', res.data.Authorization);
						uni.setStorageSync('openId', res.data.openid);
						uni.setStorageSync('unionId', res.data.unionid);
						this.getMemberInfo(() => {
							this.navCodePage()
							this.isHomePageBack();
						});
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
						})
					}
				})
			},
			// 返回手机号码登录
			returnNumberLogin() {
				this.showTips2 = false,
					this.wxPhoneLoginVerify = false
				this.form.phoneNo = ''
				this.form.codeNum = ''
				clearInterval(this.getCodeTimer)
				this.isShowCode = true

			},
			// 切换验证码登录
			wxPhoneLogin() {
				this.isWxPhoneLogin = true
				this.returnNumberLogin()
			},
			getPhoneStr(phone) {
				if (!phone && phone.length != 11) {
					return 'xxx'
				} else {
					let phoneArr = [phone.substring(0, 3), phone.substring(3, 7), phone.substring(7, 11)]
					return phoneArr.join('-')
				}
			},
			// 扫码跳转
			navCodePage() {
				setTimeout(() => {

					// #ifdef H5
					let gunDetailUrl = uni.getStorageSync('gunDetailUrl')
					
					if(gunDetailUrl){
						uni.removeStorageSync('gunDetailUrl')
						if(this.isCYCAPPInH5()){
							// #川逸充app内嵌的h5这个调用window.location.href = gunDetailUrl会直接卡死，放弃它
							let url = gunDetailUrl.split('#')[1]
							uni.redirectTo({ url })
						}else{
							setTimeout(() => {
								window.location.href = gunDetailUrl
							}, 2000);
						}
					}
					// #endif

					if (this.qrCodeUrl) {
						uni.navigateTo({
							url: this.qrCodeUrl
						})
						return
					}
					this.qrCode && scanCode_1.scanCodeFn(this.qrCode)
				}, 1000)
			},

		}
	};
</script>
<style lang="less" scoped>
	@import url("@/commin/flex.less");

	.loginBox {
		width: 750rpx;
		min-height: 100vh;
		background-color: #fff;
		text-align: center;
		padding-top: 15%;
		box-sizing: border-box;


		.content {
			width: 702rpx;
			// background: linear-gradient(0deg, #FFFFFF, #F4F6F8);
			// border: 2rpx solid #FFFFFF;
			// box-shadow: 4px 7px 20px 0px rgba(166, 171, 179, 0.24);
			border-radius: 16rpx;
			margin: 0 auto;
			padding-bottom: 200rpx;

			.header-image {
				width: 322rpx;
				height: 200rpx;
				margin: 80rpx 0 0 0;
			}

			.xj-header-image {
				width: 416rpx;
				height: 162rpx;
				margin: 80rpx 0 0 0;
			}

			.loginTip {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #313331;
				line-height: 45rpx;
				padding-top: 20rpx;
			}

			.btn1 {
				width: 632rpx;
				height: 88rpx;
				line-height: 88rpx;
				background: var(--btnColor);
				border-radius: 44rpx 44rpx 44rpx 44rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #fff;
				opacity: 0.97;
				margin: 83rpx 59rpx 30rpx 59rpx;
			}

			.btn {
				width: 632rpx;
				height: 88rpx;
				line-height: 88rpx;
				background: #C0C4CC;
				border-radius: 44rpx 44rpx 44rpx 44rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #fff;
				opacity: 0.97;
				margin: 80rpx auto 40rpx;
			}

			.btn2 {
				width: 632rpx;
				height: 88rpx;
				line-height: 88rpx;
				background-color: var(--btnColor);
				border-radius: 44rpx 44rpx 44rpx 44rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #fff;
				opacity: 0.97;
				margin: 80rpx auto 40rpx;
			}

			.loginType {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 0 40rpx;
				margin: 40rpx 0;
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 400;

				.tab {
					color: var(--textColor);
				}

				.pass {
					color: #969996;
				}
			}
		}

		.gy_agree {
			margin-top: 40rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;

			.img {
				width: 30rpx;
				height: 30rpx;
				margin-right: 18rpx;
			}

			.txt {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #606266;

				text {
					color: var(--textColor);
				}
			}
		}

		.agree {
			position: fixed;
			bottom: 60rpx;
			// margin-top:40rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;

			.img {
				width: 30rpx;
				height: 30rpx;
				margin-right: 18rpx;
			}

			.txt {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #606266;

				text {
					color: var(--textColor);
				}
			}
		}
	}

	.popupTitle {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #1a1a1a;
		margin: 40rpx 0;
		text-align: center;
	}

	.popupTxt {
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #303133;
		line-height: 45rpx;
		padding: 0 40rpx;
		margin-bottom: 60rpx;
		text-align: center;

		text {
			color: var(--textColor);
		}
	}

	.popupBtn {
		border: 1px solid #DCDFE6;
		display: flex;

		.popupBtn1 {
			flex: 1;
			height: 88rpx;
			line-height: 88rpx;
			border: 0;
			border-right: 1px solid #DCDFE6;
			text-align: center;
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #606266;
			background: none;
			padding: 0;

			&::after {
				border: 0;
			}
		}

		.popupBtn2 {
			flex: 1;
			height: 88rpx;
			line-height: 88rpx;
			text-align: center;
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #6EB12F;
			background: none;
			border: 0;
			padding: 0;

			&::after {
				border: 0;
			}

			// margin-left: 24rpx;
		}
	}

	.verify-box {
		.verify-title {
			text-align: center;
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #606266;
			line-height: 45rpx;
		}

		.verify-code {
			display: flex;
			justify-content: center;
			align-items: center;
			margin: 32rpx 0;

			image {
				height: 52rpx;
				max-width: 200rpx;
			}

			text {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: var(--textColor);
				margin-left: 40rpx;
			}
		}

		.verify-input {
			border: 1px solid #909399;
			border-radius: 16rpx;
			height: 70rpx;
			padding-left: 24rpx;
			margin: 0 32rpx;

			.placeholderStyle {
				font-size: 26rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #909399;
			}
		}
	}

	.form {
		width: 600rpx;
		margin: 0 auto;
		margin-top: 80rpx;

		.form_item {
			border-bottom: 1rpx solid #D2D2D2;
			height: 100rpx;

			image {
				width: 18rpx;
				height: 18rpx;
				margin-right: 20rpx;
			}

			input {
				text-align: start;
			}

			.code {
				border: 1px solid #CACCCA;
				font-size: 22rpx;
				color: #fff;
				padding: 16rpx 30rpx;
				margin-right: 20rpx;
				border-radius: 60rpx;
				color: #CACCCA;

				&.code2 {
					border-color: var(--textColor);
					background: var(--btnColor);
					color: #fff;
				}
			}
		}
	}

	.uni-input-placeholder {
		text-align: start;
	}

	// 手机验证码的样式
	.wxPhoneLogin {
		font-size: 28rpx;
		font-weight: 400;
		color: #606266;
		line-height: 28rpx;
		padding-bottom: 60rpx;
	}

	.wxPhoneLoginWrap {
		.tips {
			font-size: 28rpx;
			font-weight: 400;
			color: #606266;
			line-height: 28rpx;
			margin-top: 50rpx;
		}

		.wxPhoneLoginVerifyCode {
			margin-top: 70rpx;

			.wxPhoneLoginVerifyCode_item {
				width: 64rpx;
				height: 64rpx;
				background: #FFFFFF;
				border-radius: 10rpx 10rpx 10rpx 10rpx;
				opacity: 0.9;
				border: 2rpx solid #C0C4CC;
				margin-right: 28rpx;
			}
		}

		.wxPhoneLoginVerifyFocus {
			position: fixed;
			left: -200rpx;
			top: -200rpx;
		}
	}
</style>